package org.dromara.solonplugins.kafka1;

import java.time.Duration;
import java.util.List;

import org.apache.kafka.common.serialization.StringDeserializer;

/**
 * 消费者
 */
public class Kafka1ConsumerProperties {
	
	/**
	 * Frequency with which the consumer offsets are auto-committed to Kafka if
	 * 'enable.auto.commit' is set to true.
	 */
	private Duration autoCommitInterval;

	/**
	 * What to do when there is no initial offset in Kafka or if the current offset no
	 * longer exists on the server.
	 */
	private String autoOffsetReset;

	/**
	 * Comma-delimited list of host:port pairs to use for establishing the initial
	 * connections to the Kafka cluster. Overrides the global property, for consumers.
	 */
	private List<String> bootstrapServers;

	/**
	 * ID to pass to the server when making requests. Used for server-side logging.
	 */
	private String clientId;

	/**
	 * Whether the consumer's offset is periodically committed in the background.
	 */
	private Boolean enableAutoCommit;
	
	private Duration sessionTimeout;
	
	private Duration requestTimeout;

	/**
	 * Maximum amount of time the server blocks before answering the fetch request if
	 * there isn't sufficient data to immediately satisfy the requirement given by
	 * "fetch-min-size".
	 */
	private Duration fetchMaxWait;

	/**
	 * Minimum amount of data the server should return for a fetch request.
	 */
	private long fetchMinSize;

	/**
	 * Unique string that identifies the consumer group to which this consumer
	 * belongs.
	 */
	private String groupId;

	/**
	 * Expected time between heartbeats to the consumer coordinator.
	 */
	private Duration heartbeatInterval;
	
	private long maxPartitionFetchBytes;
	/**
	 * Isolation level for reading messages that have been written transactionally.
	 */
//	private IsolationLevel isolationLevel = IsolationLevel.READ_UNCOMMITTED;

	/**
	 * Deserializer class for keys.
	 */
	private Class<?> keyDeserializer = StringDeserializer.class;

	/**
	 * Deserializer class for values.
	 */
	private Class<?> valueDeserializer = StringDeserializer.class;

	/**
	 * Maximum number of records returned in a single call to poll().
	 */
	private Integer maxPollRecords;
	
	private Integer concurrency;

	public Duration getAutoCommitInterval() {
		return autoCommitInterval;
	}

	public void setAutoCommitInterval(Duration autoCommitInterval) {
		this.autoCommitInterval = autoCommitInterval;
	}

	public String getAutoOffsetReset() {
		return autoOffsetReset;
	}

	public void setAutoOffsetReset(String autoOffsetReset) {
		this.autoOffsetReset = autoOffsetReset;
	}

	public List<String> getBootstrapServers() {
		return bootstrapServers;
	}

	public void setBootstrapServers(List<String> bootstrapServers) {
		this.bootstrapServers = bootstrapServers;
	}

	public String getClientId() {
		return clientId;
	}

	public void setClientId(String clientId) {
		this.clientId = clientId;
	}

	public Boolean getEnableAutoCommit() {
		return enableAutoCommit;
	}

	public void setEnableAutoCommit(Boolean enableAutoCommit) {
		this.enableAutoCommit = enableAutoCommit;
	}

	public Duration getSessionTimeout() {
		return sessionTimeout;
	}

	public void setSessionTimeout(Duration sessionTimeout) {
		this.sessionTimeout = sessionTimeout;
	}

	public Duration getRequestTimeout() {
		return requestTimeout;
	}

	public void setRequestTimeout(Duration requestTimeout) {
		this.requestTimeout = requestTimeout;
	}

	public Duration getFetchMaxWait() {
		return fetchMaxWait;
	}

	public void setFetchMaxWait(Duration fetchMaxWait) {
		this.fetchMaxWait = fetchMaxWait;
	}


	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public Duration getHeartbeatInterval() {
		return heartbeatInterval;
	}

	public void setHeartbeatInterval(Duration heartbeatInterval) {
		this.heartbeatInterval = heartbeatInterval;
	}


	public Class<?> getKeyDeserializer() {
		return keyDeserializer;
	}

	public void setKeyDeserializer(Class<?> keyDeserializer) {
		this.keyDeserializer = keyDeserializer;
	}

	public Class<?> getValueDeserializer() {
		return valueDeserializer;
	}

	public void setValueDeserializer(Class<?> valueDeserializer) {
		this.valueDeserializer = valueDeserializer;
	}

	public Integer getMaxPollRecords() {
		return maxPollRecords;
	}

	public void setMaxPollRecords(Integer maxPollRecords) {
		this.maxPollRecords = maxPollRecords;
	}

	public Integer getConcurrency() {
		return concurrency;
	}

	public void setConcurrency(Integer concurrency) {
		this.concurrency = concurrency;
	}

	public long getFetchMinSize() {
		return fetchMinSize;
	}

	public void setFetchMinSize(long fetchMinSize) {
		this.fetchMinSize = fetchMinSize;
	}

	public long getMaxPartitionFetchBytes() {
		return maxPartitionFetchBytes;
	}

	public void setMaxPartitionFetchBytes(long maxPartitionFetchBytes) {
		this.maxPartitionFetchBytes = maxPartitionFetchBytes;
	}
	
	

}
